﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using ERP_RORZE_PERMISSION.Base;
using ERP_RORZE_PRODUCT.Product.DAO;

namespace ERP_RORZE_PRODUCT.Product.Incauhinhmoi
{
    public partial class frm_ResionEdit : DevExpress.XtraEditors.XtraForm
    {

        public event EventHandler Reload;
        DataTable dt;
        ClsIncauhinhDAO clsConfigureDAO = new ClsIncauhinhDAO();
        private LogUtils log;

        public string ResionID;
        public frm_ResionEdit()
        {
            InitializeComponent();
            log = new LogUtils();
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (txtRessionID.Text == "")
            {
                MessageBox.Show("Chưa nhập RessionID");
            }
            else
            {
                clsConfigureDAO.UpdateRession(txtRessionID.Text, ResionID);

                //write Log
                log.Table = LogConstant.Table.Product.RessionList;
                log.Task = LogConstant.Task.Update;
                log.Description = "RessionID: " + txtRessionID.Text;
                log.WriteLog();

                MessageBox.Show("Đã nhập xong");
                Reload(sender, e);
            }
        }

        private void frm_ResionEdit_Load(object sender, EventArgs e)
        {
            txtRessionID.Text = ResionID;
        }
    }
}